package br.com.ZeroHora.DAO;

/**
 *
 * @author Gledson
 */

import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.PreparedStatement;
import java.sql.ResultSet;

public class DAO {
    
    Connection con;
    PreparedStatement pstmt;
    ResultSet rs;
    
    public void openDatabase() throws Exception{
        Class.forName("com.mysql.jdbc.Driver");
        String url = "jdbc:mysql://localhost:3306/imobiliaria";
        String usuario = "root";
        String senha = "1020gle";
        con = DriverManager.getConnection(url,usuario,senha);
    }
    
    public void closeDatabase() throws Exception{
        if(con != null)
            con.close();
}
}
